package messages.udp;

import messages.BaseMessage;
import messages.MessageType;

public class PersonPressButtonMessage extends BaseMessage {
    byte button;
    public PersonPressButtonMessage(byte[] data)
    {
        super(data);
        button = data[1];
    }
    
    public PersonPressButtonMessage(byte pressButton){
    	super(null);
    	this.button = pressButton;
    }

    @Override
    public byte[] toByteArray()
    {
        byte[] retVal = new byte[getMessageSize()];
        retVal[0] = getMessageType().getIdentifier();
        retVal[1] = button;
        return retVal;
    }

    @Override
    public MessageType getMessageType()
    {
        return MessageType.PersonPressButtonMessage;
    }

    @Override
    public int getMessageSize()
    {
        return 2;
    }

}
